#!/bin/bash

#Usage:
#fix_nfsvers <nfs ver list>

_vers="$*"
utilsVer=$(mount.nfs -V | awk -F '[ )]+' '{print $4}')

if vercmp $utilsVer '>=' 1.3; then
	_vers=$(egrep -o "[.0-9]+" <<<"$_vers" | sed -e "s/^4$/4.0/")
else
	_vers=$(egrep -o "[.0-9]+" <<<"$_vers" | sed -e "s/^4.0$/4/")
fi
vercmp $(uname -r) '>=' 3.10 && {
	_vers=$(egrep -o "[.0-9]+" <<<"$_vers" | sed -e "/^2$/d")
}
echo $_vers
